import  {  useEffect } from 'react'
import type { TableColumnsType } from 'antd';
import { Finance4 } from '@/stores/Finance4';
import { useSnapshot } from 'valtio';
import WHeaders from '@/components/WHeaders';
import WTables from '@/components/WTables';
export default function Storestatement() {
  const finance= useSnapshot(Finance4)
  interface DataType {
    key: string;
    brand?: string;
    platform?: string;
    date?: string;
    shop?: string;
    Totalorderquantity: number;
    Settledorders: number;
    Unsubscribeorder: number;
    businesssales: number;
    Paidinamount: number;
    Deliveryfee: number;
    Platformsubsidies: number;
    servicecharge: number;
    children?: DataType[];
  }
  const columns: TableColumnsType<DataType> = [
    {
      title: '日期',
      dataIndex: 'date',
      key: "1"
    },
    {
      title: '店铺',
      dataIndex: 'shop',
      key: "2"
    },
    {
      title: '订单总量',
      dataIndex: 'Totalorderquantity',
      key: "3"
    },
    {
      title: '已结算订单',
      dataIndex: 'Settledorders',
      key: "4"
    },
    {
      title: '退订订单',
      dataIndex: 'Unsubscribeorder',
      key: "5"
    },
    {
      title: '总营业额',
      dataIndex: 'businesssales',
      key: "6"
    },
    {
      title: '实付金额', dataIndex: 'Paidinamount',
      key: "7",
    },
    {
      title: '配送费',
      dataIndex: 'Deliveryfee',
      key: "8"
    },
    {
      title: '平台补贴',
      dataIndex: 'Platformsubsidies',
      key: "9"
    },
    {
      title: '服务费',
      dataIndex: 'servicecharge',
      key: "10"
    }

  ];
  useEffect(() => {
    finance.getList()
  },[])
  return (
    <div>
      <WHeaders finance={Finance4} />
      <WTables columns={columns} data={finance.data} title={"门店销售日报"} />
    </div>
  )
}

